<?php
/**
* 3D饼状图 薄的, 倾斜45°
*
 * PHP version 5
 *
 * @package   Ecga
 * @author    Farmer.Li <none@none.com>
 * @copyright 2010 Xingchangxinda Inc.
 * @version   SVN: $Id$
 */
namespace Project\Apps\Ecga\Library\FusionCharts;

use \Project\Apps\Ecga\Library\FusionCharts\ChartXml;
use \Exception;

/**
* 3D饼状图 薄的, 倾斜45°
*
 * PHP version 5
 *
 * @package   Ecga
 * @author    Farmer.Li <none@none.com>
 * @copyright 2010 Xingchangxinda Inc.
 * @version   Release: <0.2>
 */
class Pie3DThinbias extends ChartXml
{
	/**
	 * 构造函数
	 * 
	 * @param sstring $caption 图表说明
	 * @param array   $slices  切片数据
	 * @param array   $style   样式属性
	 * 
	 * @return void
	 */
	public function __construct($caption, $slices, $style = array())
	{
		parent::__construct($caption);
		$this->_setSlices($slices);
		if ($style) {
			$this->setStyle($style);
		}
		$this->setStyle(array('decimalPrecision' => '2'));
	}
	/**
	 * 设置切片数据
	 * 
	 * @param string $slices 切片
	 * 
	 * @return void
	 */
	private function _setSlices($slices)
	{
		foreach ($slices as $key => $value) {
			$this->data['__child'][] = array(
				'tagName' => 'set',
				'__attr' => array(
					'label' => $key,
					'value' => $value,
					'isSliced' => 0
				)
			);
		}
	}
}